package com.itheima.api.treeset.demo;

import java.util.TreeSet;

public class TreeSetDemo {

    public static void main(String[] args) {

        TreeSet<Integer> treeSet = new TreeSet<Integer>();

        treeSet.add(20);
        treeSet.add(18);
        treeSet.add(23);

        treeSet.add(22);
        treeSet.add(17);
        treeSet.add(24);
        treeSet.add(19);

        treeSet.forEach(s -> System.out.println(s));

    }
}
